//
//  UserAccount.h
//  OC-LBWeibo
//
//  Created by 李博 on 15/7/9.
//  Copyright © 2015年 libo. All rights reserved.
//

#import <Foundation/Foundation.h>

#define LBSwitchRootVCNotification @"LBSwitchRootVCNotification"

@interface UserAccount : NSObject <NSCoding>

/// 用于调用access_token，接口获取授权后的access token
@property(nonatomic,copy)NSString *access_token;
/// access_token的生命周期，单位是秒数(实际是数值！)
@property(nonatomic,assign)NSTimeInterval expires_in;
/// 当前授权用户的UID
@property(nonatomic,copy)NSString *uid;

///过期时间
@property(nonatomic,strong)NSDate *expiresDate;

@property(nonatomic,copy)NSString *name;

@property(nonatomic,copy)NSString *avatar_large;


+ (UserAccount *)sharedUserAccount;

+ (instancetype)userWithDict:(NSDictionary *)dict;

- (void)loadUserInfo:(void (^) (UserAccount *account, NSError *error)) finished;

//保存用户信息到沙盒
- (void)saveAccount;
- (UserAccount *)loadAccount;


@end
